$(function() {
	$("#form").validate({
		rules : {
			"grant.grantmoney" : {required : true,number:true},
			"grant.startdate" : {required : true},
			"grant.enddate" : {required : true},
		},
		messages : {
			"grant.grantmoney" : {required:'请输入授信额度!',number:"授信额度只能为数字！"},
			"grant.startdate" : {required : '请选择授信起始日期!'},
			"grant.enddate" : {required : '请选择授信到期日期!'},
		},
		submitHandler:function(form) {
			if(!timeCompareTo("#startdate","#enddate")){
				alert('授信起始日期应小于授信到期日期');
				return false;
			}
			$customname=$("#customname").val();
			$grantmoney=$("#grantmoney").val();
			$startdate=$("#startdate").val();
			$enddate=$("#enddate").val();
			$msg="客户"+$customname+"的授信额度为"+$grantmoney+"元，授信期限为"+$startdate+"至"+$enddate+".确定要对其进行授信吗？"
			SubmitDialog("",$msg);

		}
	});
})
